<?php

use yii\helpers\Html;
use kartik\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\modules\business\models\BusinessDiseaseTypeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '疾病类型';
$this->params['breadcrumbs'][] = $this->title;
?>


<section class="wrapper site-min-height">
    <!-- page start-->
    <section class="panel">
        <header class="panel-heading">
              <?= Html::a('返回','javascript:history.back(-1)'); ?>  <?= Html::encode($this->title) ?>
        </header>
        <div class="panel-body">
            <div class="adv-table editable-table ">
 


<div class="business-disease-type-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('添加疾病', ['create'], ['class' => 'btn btn-success']) ?>
    </p>



    <?php
        echo GridView::widget([
            'dataProvider'=>$dataProvider,
            'filterModel'=>$searchModel,
            'showPageSummary'=>true,
            'pjax'=>true,
            'striped'=>true,
            'hover'=>true,
            'panel'=>['type'=>'primary', 'heading'=>'疾病管理'],
            'containerOptions'=>['style'=>'overflow: auto'], // only set when $responsive = false
            'headerRowOptions'=>['class'=>'kartik-sheet-style'],
            'filterRowOptions'=>['class'=>'kartik-sheet-style'],
            'columns'=>[

                [
                    'attribute'=>'name',
                    'pageSummaryOptions'=>['class'=>'text-right text-warning'],
                    'width'=>'100px',
                ],
                [
                    'attribute'=>'detail',
                    'pageSummaryOptions'=>['class'=>'text-right text-warning'],
                    'width'=>'100px',
                ],
                [
                    'attribute'=>'createtime',
                    'value' => function($model){
                        return date('Y-m-d H:i:s',$model->createtime);
                    },
                    'pageSummaryOptions'=>['class'=>'text-right text-warning'],
                    'width'=>'100px',
                ],
                [
                    'class' => '\kartik\grid\ActionColumn',
                    'deleteOptions' => ['label' => '<i class="glyphicon glyphicon-remove"></i>']
                ],

                [
                    'class' => '\kartik\grid\CheckboxColumn'
                ]
            ],
            'toolbar'=> [
                Yii::$app->request->get('id') !== null?[
                    'content' => Html::button('<i class="glyphicon glyphicon-plus"></i>', ['type'=>'button', 'title'=>'选中归为档案', 'class'=>'btn btn-success', 'id'=>'addpig'])
                ]:'',
                '{export}',
                '{toggleData}',
            ],
            'bordered'=>true,
            'condensed'=>true,
        ]);
    ?>

</div>
</div>
</div>
</section>
</section>





